package com.warrior.superdata.mysql.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.warrior.superdata.exceptionhandler.ApplicationException;
import com.warrior.superdata.mysql.entity.ApiDatasource;
import com.warrior.superdata.mysql.entity.dto.ApiDatasourceDto;
import com.warrior.superdata.mysql.entity.dto.TableFieldDto;

import java.util.List;
import java.util.Set;

/**
 * @Description:
 * @ClassName: ApiDatasourceSerivce.java
 * @date: 2022/3/2 18:08
 * @author xujian
 */
public interface ApiDatasourceSerivce extends IService<ApiDatasource> {

    List<String> testSourceConnect(ApiDatasourceDto apiDatasourceDto) throws ApplicationException;

    void addDatasource(ApiDatasourceDto apiDatasourceDto);

    List<ApiDatasource> getDatasourceList(Integer type);

    Set<String> getTables(String datasourceCode, String dataBaseName);

    List<String> getDatabases(String datasourceCode);

    List<TableFieldDto> getTableFields(String datasourceCode, String dataBaseName, String tableName);

    ApiDatasource checkApiDatasource(String datasourceCode);
}
